<template>
  <div>
    <button type="button" class="btn btn-primary">{{ msg }}</button>
  </div>
</template>

<script>
  import axios from 'axios'

  export default {
    name: "Ping",
    data() {
      return {
        msg: ""
      }
    },
    created() {
      this.getMessage();
    },
    methods: {
      getMessage() {
        const url = "http://127.0.0.1:5000/api/ping";
        axios.get(url)
          .then((res) => {
            this.msg = res.data;
          })
          .catch((error) => {
            console.log(error);
          })
      }

    }
  }
</script>

<style scoped>

</style>
